package drds.common.db.xml_mapping.builder;


import drds.common.db.xml_mapping.mapping.ResultMap;
import drds.common.db.xml_mapping.mapping.ResultMapping;

import java.util.List;


public class ResultMapResolver {
  private final MapperBuilderAssistant mapperBuilderAssistant;
  private final String id;
  private final Class<?> type;
  private final String extend;

  private final List<ResultMapping> resultMappings;
  private final Boolean autoMapping;

  public ResultMapResolver(MapperBuilderAssistant mapperBuilderAssistant, String id, Class<?> type, String extend, List<ResultMapping> resultMappings, Boolean autoMapping) {
    this.mapperBuilderAssistant = mapperBuilderAssistant;
    this.id = id;
    this.type = type;
    this.extend = extend;

    this.resultMappings = resultMappings;
    this.autoMapping = autoMapping;
  }

  public ResultMap resolve() {
    return mapperBuilderAssistant.addResultMap(this.id, this.type, this.extend, this.resultMappings, this.autoMapping);
  }

}
